<?php

namespace frontend\modules\exmall\controllers;

use Yii;
use frontend\components\Controller;

/**
 * 兑换商城首页
 * Default controller for the `exmall` module
 */
class DefaultController extends Controller {

    /**
     * @inheritdoc
     */
    public function actionIndex() {
        $username = $this->token->user ? $this->token->user->username : 'test';
        return [
            'message' => 'Hello World!',
            'user' => [
                'username' => $username,
                'avatar' => 'https://gitee.com/uploads/14/637814_77252102.png?1481090376',
                'credits' => 500,
                'link' => 'http://mysapce',
            ],
            'carousels' => [
                'http://api.lunengsports.net/vue/01.png',
                'http://api.lunengsports.net/vue/02.png',
                'http://api.lunengsports.net/vue/03.png'
            ],
            'categories' => [
                [
                    'id' => 1,
                    'title' => '钥匙扣',
                    'url' => '',
                    'thumb' => 'http://api.lunengsports.net/vue/c1.png'
                ],
                [
                    'id' => 2,
                    'title' => '球鞋',
                    'url' => '',
                    'thumb' => 'http://api.lunengsports.net/vue/c2.png'
                ],
                [
                    'id' => 3,
                    'title' => '运动装备',
                    'url' => '',
                    'thumb' => 'http://api.lunengsports.net/vue/c3.png'
                ],
                [
                    'id' => 4,
                    'title' => '球帽',
                    'url' => '',
                    'thumb' => 'http://api.lunengsports.net/vue/c4.png'
                ],
                [
                    'id' => 5,
                    'title' => '全部',
                    'url' => '',
                    'thumb' => 'http://api.lunengsports.net/vue/c5.png'
                ],
            ],
            'goods' => [
                [
                    'id' => 1,
                    'title' => '商品1',
                    'url' => '',
                    'thumb' => 'https://img.yzcdn.cn/public_files/2017/10/24/320454216bbe9e25c7651e1fa51b31fd.jpeg',
                    'price' => 2000
                ],
                [
                    'id' => 2,
                    'title' => '商品2',
                    'url' => '',
                    'thumb' => 'https://img.yzcdn.cn/public_files/2017/10/24/2f9a36046449dafb8608e99990b3c205.jpeg',
                    'price' => 2000
                ],
                [
                    'id' => 3,
                    'title' => '商品3',
                    'url' => '',
                    'thumb' => 'https://img.yzcdn.cn/public_files/2017/10/24/f6aabd6ac5521195e01e8e89ee9fc63f.jpeg',
                    'price' => 2000
                ],
            ]
        ];
    }

}
